import { Injectable } from '@nestjs/common';
import { Dog } from './interfaces/dog.interface';

@Injectable()
export class DogService {
  private readonly dog: Dog[] = [];

  create(dog: Dog) {
    this.dog.push(dog);
  }

  findAll(): Dog[] {
    console.log(this.dog);

    return this.dog;
  }

  findOne(id: number): Dog {
    return this.dog.find((item) => item.id === id);
  }
}
